package com.ssm.user.designPattern.responseibilityChainPattern;

import org.apache.commons.collections4.CollectionUtils;

public class RuleCheckContext {

    /**
     * 规则检查结果(下一个链执行时，要检查上一个链的结果，看是否有错误，有错误就直接返回，不会向下传递、执行)
     */

    private RuleCheckResult ruleCheckResult = new RuleCheckResult();

    public RuleCheckResult getRuleCheckResult() {
        return ruleCheckResult;
    }

    public boolean hasError() {
        return CollectionUtils.isNotEmpty(ruleCheckResult.getFailedMsgList());
    }
}
